import request from '@/utils/request';

//获取所有学员列表
export const getAllStudentList = (params, companyId) => {
    return request({
        url: '/admin/ucenter/student/list/' + companyId,
        method: 'get',
        params: params
    })
}

//获取分页学员列表
export const queryList = (page, limit, params, companyId) => {
    return request({
        url: '/admin/ucenter/student/list/' + page + '/' + limit + '/' + companyId,
        method: 'get',
        params: params
    })
}

//删除学员用户
export const removeStudent = (id) => {
    return request({
        url: '/admin/ucenter/student/remove/' + id,
        method: 'delete',
    })
}

//删除选中学员用户
export const removeStudentSelected = (idList) => {
    return request({
        url: '/admin/ucenter/student/batch-remove',
        method: 'delete',
        data: idList
    })
}

//修改学员信息
export const updateInfo = (form) => {
    return request({
        url: '/admin/ucenter/student/update',
        method: 'put',
        data: form
    })
}

//新增学员信息
export const addInfo = (form) => {
    return request({
        url: '/admin/ucenter/student/save',
        method: 'post',
        data: form
    })
}

//查看学习时长
export const getStudyTime = (studentId) => {
    return request({
        url: '/edu/videoRecord/getTotalCost',
        method: 'get',
        params: { studentId }
    })
}

//查看学员所有学习记录
export const getRecordsByStudentId = (studentId) => {
    return request({
        url: '/edu/videoRecord/getRecordsByStudentId',
        method: 'get',
        params: { studentId }
    })
}

//筛选学员
export const getIllegalStudent = (classId) => {
    return request({
        url: '/eduM2/eduClass/getIllegalStudentIdsByClassId/' + classId,
        method: 'get'
    })
}

// 获取学员课程学习记录
export const getCourseRecordList = (studentId, courseId) => {
    return request({
        url: '/edu/videoRecord/getCourseAndVideoRecordList/' + studentId,
        method: 'get'
    })
}

// 获取学员视频学习记录
export const getVideoRecordList = (studentId, courseId) => {
    return request({
        url: '/edu/videoRecord/getVideoRecordList/' + studentId + '/' + courseId,
        method: 'get'
    })
}

// 获取未分班学员列表
export const getUnClassStudentList = (companyId, params) => {
    return request({
        url: '/admin/ucenter/student/showUserListWithoutClass/' + companyId,
        method: 'get',
        params:{
            id: params.id,
            username: params.username,
            idCard: params.idCard,
            mobile: params.mobile,
        }
    })
}